{% load static %}
<!DOCTYPE html>
<html lang="en">

<head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>股票信息平台</title>
    <!-- plugins:css -->
    <link rel="stylesheet" href="{% static 'vendors/mdi/css/materialdesignicons.min.css' %}">
    <link rel="stylesheet" href="{% static 'vendors/base/vendor.bundle.base.css' %}">
    <!-- endinject -->
    <!-- plugin css for this page -->
    <link rel="stylesheet" href="{% static 'vendors/datatables.net-bs4/dataTables.bootstrap4.css' %}">
    <!-- End plugin css for this page -->
    <!-- inject:css -->
    <link rel="stylesheet" href="{% static 'css/style.css' %}">
    <!-- endinject -->
    <script type="text/javascript" src="{% static 'js/echarts.min.js' %}"></script>
    <script src="{% static 'js/jquery-3.6.0.min.js' %}"></script>

</head>
<body>
<div class="container-scroller">
    <!-- partial:partials/_navbar.html -->
    <nav class="navbar col-lg-12 col-12 p-0 fixed-top d-flex flex-row mr-1">
        <div class="navbar-brand-wrapper d-flex justify-content-center">
            <div class="navbar-brand-inner-wrapper d-flex justify-content-between align-items-center w-100">
                <a class="navbar-brand brand-logo" href="{% url 'index' %}"><img src="{% static 'images/logo.svg' %}"
                                                                                 alt="logo"/></a>
                <button class="navbar-toggler navbar-toggler align-self-center" type="button" data-toggle="minimize">
                    <span class="mdi mdi-sort-variant"></span>
                </button>
            </div>

        </div>
        <div class="navbar-menu-wrapper d-flex align-items-center justify-content-end">


            <ul class="navbar-nav navbar-nav-right">
                {% if request.user_obj %}
                    <ul class="nav-item nav-profile dropdown">
                        <a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown" id="profileDropdown">
                            {#                        <img src="{% static 'images/faces/face5.jpg' %}" alt="profile"/>#}
                            <i class="mdi mdi-account menu-icon"></i>
                            <span class="nav-profile-name">{{ request.user_obj.username }}</span>
                        </a>
                        <div class="dropdown-menu dropdown-menu-right navbar-dropdown"
                             aria-labelledby="profileDropdown">
                            <li class="dropdown-item">
                                <i class="mdi mdi-settings text-primary"></i>
                                <a href="#">管理中心</a>
                            </li>
                            <li class="dropdown-item">
                                <i class="mdi mdi-logout text-primary"></i>
                                <a href="{% url 'logout' %}">退 出</a>
                            </li>
                        </div>
                    </ul>
                {% else %}
                    <li class="nav-item dropdown mr-4">
                        <a class="nav-link count-indicator dropdown-toggle d-flex justify-content-center align-items-center"
                           href="{% url 'login' %}">
                            <span>登录</span>
                        </a>
                    </li>
                    <li class="nav-item dropdown mr-4">
                        <a class="nav-link count-indicator dropdown-toggle d-flex justify-content-center align-items-center"
                           href="{% url 'register' %}">
                            <span>注册</span>
                        </a>
                    </li>
                {% endif %}

            </ul>
            <button class="navbar-toggler navbar-toggler-right d-lg-none align-self-center" type="button"
                    data-toggle="offcanvas">
                <span class="mdi mdi-menu"></span>
            </button>
        </div>
    </nav>
    <!-- partial -->
    <div class="container-fluid page-body-wrapper">
        <!-- partial:partials/_sidebar.html -->
        <nav class="sidebar sidebar-offcanvas" id="sidebar">
            <ul class="nav">
                <li id="home" class="nav-item">
                    <a class="nav-link" href={% url 'index' %}>
                        <i class="mdi mdi-home menu-icon"></i>
                        <span class="menu-title">首页</span>
                    </a>
                </li>
                <li id="stock" class="nav-item">
                    <a class="nav-link" href={% url 'stock' %}>
                        <i class="mdi mdi-circle-outline menu-icon"></i>
                        <span class="menu-title">个股</span>
                    </a>
                </li>
                <li id="industry" class="nav-item">
                    <a class="nav-link" href={% url 'industry' %}>
                        <i class="mdi mdi-view-headline menu-icon"></i>
                        <span class="menu-title">行业</span>
                    </a>
                </li>
                <li id="stock_index" class="nav-item">
                    <a class="nav-link" href={% url 'stock_index' %}>
                        <i class="mdi mdi-chart-pie menu-icon"></i>
                        <span class="menu-title">指数</span>
                    </a>
                </li>
                <li id="company" class="nav-item">
                    <a class="nav-link" href={% url 'company' %}>
                        <i class="mdi mdi-grid-large menu-icon"></i>
                        <span class="menu-title">公司</span>
                    </a>
                </li>
                <li id="concept" class="nav-item">
                    <a class="nav-link" href={% url 'concept' %}>
                        <i class="mdi mdi-emoticon menu-icon"></i>
                        <span class="menu-title">概念</span>
                    </a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" data-toggle="collapse" href="#auth" aria-expanded="false" aria-controls="auth">
                        <i class="mdi mdi-account menu-icon"></i>
                        <span class="menu-title">用户中心</span>
                        <i class="menu-arrow"></i>
                    </a>
                    <div class="collapse" id="auth">
                        <ul class="nav flex-column sub-menu">
                            <li class="nav-item"><a class="nav-link" href="{% url 'register' %}"> 注册 </a></li>
                            <li class="nav-item"><a class="nav-link" href="{% url 'login' %}"> 登录 </a>
                            </li>
                            <li class="nav-item"><a class="nav-link" href="{% url 'logout' %}"> 退出 </a>
                            </li>
                        </ul>
                    </div>
                </li>
                <li id="qa_chat" class="nav-item">
                    <a class="nav-link" href={% url 'qa_chat' %}>
                        <i class="mdi mdi-android-debug-bridge menu-icon"></i>
                        <span class="menu-title">智能问答</span>
                    </a>
                </li>
            </ul>
        </nav>

        <div class="main-panel">
            <div class="content-wrapper">
                <div class="row">
                    <div class="col-lg-12 grid-margin stretch-card">
                        <div class="card">
                            <div class="card-body">
                                <div class="industry-list-container"
                                     style="padding: 10px 24px;background: #fff;line-height: 2;font-size: 14px;border-top: none;display: block;border: 1px solid #e2e6e7;box-shadow: 0 0 5px #e2e6e7;">
                                    <div class="industry-header"
                                         style="display: flex;align-items: center;cursor: pointer;">
                                        <b class="industry-icon"
                                           style="border-left: 3px solid #3b82f4;margin-right: 3px;font-size: 8px;transition: transform 0.3s;"></b>
                                        行业名称一览
                                    </div>
                                    <div class="industry-content"
                                         style="height: 0;overflow: hidden;transition:height 0.3s;display: block;">
                                        {% for name in industry_data %}
                                            <span>{{ name.name }}</span>
                                        {% endfor %}
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-lg-12 grid-margin stretch-card">
                        <div class="card">
                            <div class="card-body">
                                <h4 class="card-title">一级-二级·行业</h4>
                                <div id="container" class="col-lg-12 "
                                     style="height: 800px;margin-right: 20px;margin-top: 20px"></div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-lg-6 grid-margin stretch-card">
                        <div class="card">
                            <div class="card-body">
                                <div class="leftFunction">
                                    <div class="searchBox">
                                        <div class="title"
                                             style="height: 45px;line-height: 45px;margin: 0px auto;font-size: 17px;position: relative;display: block">
                                            <b style="border-left: 3px solid #3b82f4;margin-right: 3px;font-size: 8px"></b>
                                            行业查询
                                        </div>
                                        <form id="indusForm" action="/app01/industry/" method="post">
                                            <div class="input-group">
                                                <input type="text" class="form-control" placeholder="请输入行业名称" name="industry_node"
                                                       value>
                                                <div class="input-group-append">
                                                    {#                        <button class="btn btn-sm btn-primary" type="" value="指数查询">Search</button>#}
                                                    <input value="行业查询" type="submit"
                                                           class="btn btn-sm btn-primary">
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                    <div style="display: none"></div>

                                    </div>
                                </div>
                            </div>
                        </div>
                    <div class="col-lg-6 grid-margin stretch-card">
                        <div class="card">
                            <div class="card-body">
                                <div class="leftFunction">

                                    <div class="resultArea">
                                        <div class="title"
                                             style="height: 45px;line-height: 45px;margin: 0px auto;font-size: 17px;position: relative;display: block">
                                            <b style="border-left: 3px solid #3b82f4;margin-right: 3px;font-size: 8px"></b>
                                            查询结果
                                        </div>
                                        <div style="margin: 20px 0px">
                                            <input type="text" id="industry_name" disabled="disabled" class="col-lg-12"
                                                   style="display: block;height: 40px;padding: 15px 5px;border-bottom: 1px solid #dee5ef">
                                            <input type="text" id="industry_level" disabled="disabled" class="col-lg-12"
                                                   style="display: block;height: 40px;padding: 15px 5px;border-bottom: 1px solid #dee5ef">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    </div>


            <div class="row">
                    <div class="col-lg-12 grid-margin stretch-card">
                        <div class="card">
                            <div class="card-body">
                               <div class="col-lg-12 grid-margin stretch-card">
                        <div class="card">
                            <div class="card-body">

                                {% if ctx %}
                                    <div >
                                        <h1 style="margin: auto">该数据库中未添加该实体</h1>
                                    </div>
                                {% else %}
                                    <div id="container_search" class="col-lg-12"
                                         style="height: 700px;">
                                    </div>
                                {% endif %}
                            </div>
                        </div>
                    </div>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- content-wrapper ends -->
            <!-- partial:../../partials/_footer.html -->


            <footer class="footer">
                <div class="d-sm-flex justify-content-center justify-content-sm-between">
                    <span class="text-muted text-center text-sm-left d-block d-sm-inline-block">06 组 赵文琳 叶晓萱 秦红 饶书琪 </span>
                    <span class="float-none float-sm-right d-block mt-1 mt-sm-0 text-center"></span>
                </div>
            </footer>


            <!-- partial -->
        </div>
        <!-- main-panel ends -->
    </div>
    <!-- page-body-wrapper ends -->
</div>
<!-- container-scroller -->

<!-- plugins:js -->
<script src="{% static 'vendors/base/vendor.bundle.base.js' %}"></script>
<!-- endinject -->
<!-- Plugin js for this page-->
<script src="{% static 'vendors/chart.js/Chart.min.js' %}"></script>
<script src="{% static 'vendors/datatables.net/jquery.dataTables.js' %}"></script>
<script src="{% static 'vendors/datatables.net-bs4/dataTables.bootstrap4.js' %}"></script>
<!-- End plugin js for this page-->
<!-- inject:js -->
<script src="{% static 'js/off-canvas.js' %}"></script>
<script src="{% static 'js/hoverable-collapse.js' %}"></script>
<script src="{% static 'js/template.js' %}"></script>
<!-- endinject -->
<!-- Custom js for this page-->
<script src="{% static 'js/data-table.js' %}"></script>
<script src="{% static 'js/jquery.dataTables.js' %}"></script>
<script src="{% static 'js/dataTables.bootstrap4.js' %}"></script>
<script type="text/javascript">
    window.onload = function () {
        var homeNav = document.getElementById('home');
        var individualNav = document.getElementById('industry');

        // 移除已选中状态的样式类
        homeNav.classList.remove('active');

        // 添加选中状态的样式类
        individualNav.classList.add('active');


        var myChart_draw = echarts.init(document.getElementById('container'));
        option = {
            backgroundColor: '#fff',
            title: {
                {#text: '一级-二级·行业',#}
                bottom: '0',
                left: 'center'
            },
            series: [
                {
                    type: 'sankey',
                    left: 50.0,
                    top: 20.0,
                    right: 150.0,
                    bottom: 25.0,
                    data: [
                        {
                            name: '汽车',
                            itemStyle: {
                                color: '#f18bbf',
                                borderColor: '#f18bbf'
                            }
                        },
                        {
                            name: '橡胶',
                            itemStyle: {
                                color: '#f18bbf',
                                borderColor: '#f18bbf'
                            }
                        },
                        {
                            name: '电子',
                            itemStyle: {
                                color: '#0078D7',
                                borderColor: '#0078D7'
                            }
                        },
                        {
                            name: '社会服务',
                            itemStyle: {
                                color: '#3891A7',
                                borderColor: '#3891A7'
                            }
                        },
                        {
                            name: '贵金属材料',
                            itemStyle: {
                                color: '#3891A7',
                                borderColor: '#3891A7'
                            }
                        },
                        {
                            name: '轻工制造',
                            itemStyle: {
                                color: '#0037DA',
                                borderColor: '#0037DA'
                            }
                        },
                        {
                            name: '机械设备',
                            itemStyle: {
                                color: '#C0BEAF',
                                borderColor: '#C0BEAF'
                            }
                        },
                        {
                            name: '信息服务',
                            itemStyle: {
                                color: '#EA005E',
                                borderColor: '#EA005E'
                            }
                        },
                        {
                            name: '基础化工',
                            itemStyle: {
                                color: '#D13438',
                                borderColor: '#D13438'
                            }
                        },
                        {
                            name: '石油石化',
                            itemStyle: {
                                color: '#D13438',
                                borderColor: '#D13438'
                            }
                        },
                        {
                            name: '家用电器',
                            itemStyle: {
                                color: '#567C73',
                                borderColor: '#567C73'
                            }
                        },
                        {
                            name: '传媒',
                            itemStyle: {
                                color: '#9ed566',
                                borderColor: '#9ed566'
                            }
                        },
                        {
                            name: '化学原料',
                            itemStyle: {
                                color: '#9ed566',
                                borderColor: '#9ed566'
                            }
                        },
                        {
                            name: '国有大型银行Ⅱ',
                            itemStyle: {
                                color: '#2BCC7F',
                                borderColor: '#2BCC7F'
                            }
                        },
                        {
                            name: '农商银行Ⅱ',
                            itemStyle: {
                                color: '#809B48',
                                borderColor: '#809B48'
                            }
                        },
                        {
                            name: '城商银行Ⅱ',
                            itemStyle: {
                                color: '#9B2D1F',
                                borderColor: '#9B2D1F'
                            }
                        },
                        {
                            name: '商贸零售',
                            itemStyle: {
                                color: '#604878',
                                borderColor: '#604878'
                            }
                        },
                        {
                            name: '交通运输',
                            itemStyle: {
                                color: '#A5644E',
                                borderColor: '#A5644E'
                            }
                        },
                        {
                            name: '化学制品',
                            itemStyle: {
                                color: '#2D3F3A',
                                borderColor: '#2D3F3A'
                            }
                        },
                        {
                            name: '股份制银行Ⅱ',
                            itemStyle: {
                                color: '#761721',
                                borderColor: '#761721'
                            }
                        },
                        {
                            name: '造纸',
                            itemStyle: {
                                color: '#B1BADD',
                                borderColor: '#B1BADD'
                            }
                        },
                        {
                            name: '文娱用品',
                            itemStyle: {
                                color: '#B0CCB0',
                                borderColor: '#B0CCB0'
                            }
                        },
                        {
                            name: '农化制品',
                            itemStyle: {
                                color: '#B0CCB0',
                                borderColor: '#B0CCB0'
                            }
                        },
                        {
                            name: '家居用品',
                            itemStyle: {
                                color: '#8164A3',
                                borderColor: '#8164A3'
                            }
                        },
                        {
                            name: '包装印刷',
                            itemStyle: {
                                color: '#8E562E',
                                borderColor: '#8E562E'
                            }
                        },
                        {
                            name: '家用轻工',
                            itemStyle: {
                                color: '#C1504D',
                                borderColor: '#C1504D'
                            }
                        },
                        {
                            name: '中药Ⅱ',
                            itemStyle: {
                                color: '#CCAF0A',
                                borderColor: '#CCAF0A'
                            }
                        },
                        {
                            name: '化学纤维',
                            itemStyle: {
                                color: '#CCAF0A',
                                borderColor: '#CCAF0A'
                            }
                        },
                        {
                            name: '生物制品',
                            itemStyle: {
                                color: '#956251',
                                borderColor: '#956251'
                            }
                        },
                        {
                            name: '医药商业',
                            itemStyle: {
                                color: '#C17529',
                                borderColor: '#C17529'
                            }
                        },
                        {
                            name: '医疗服务',
                            itemStyle: {
                                color: '#CEC597',
                                borderColor: '#CEC597'
                            }
                        },
                        {
                            name: '化学制药',
                            itemStyle: {
                                color: '#9F2936',
                                borderColor: '#9F2936'
                            }
                        },
                        {
                            name: '行业',
                            itemStyle: {
                                color: 'rgba(128,155,72,255)',
                                borderColor: 'rgba(128,155,72,255)'
                            }
                        },
                        {
                            name: '化工新材料Ⅱ',
                            itemStyle: {
                                color: 'rgba(128,155,72,255)',
                                borderColor: 'rgba(128,155,72,255)'
                            }
                        },
                        {
                            name: '医疗器械',
                            itemStyle: {
                                color: '#ac7430',
                                borderColor: '#ac7430'
                            }
                        },
                        {
                            name: '软件开发',
                            itemStyle: {
                                color: '#00BCF2',
                                borderColor: '#00BCF2'
                            }
                        },
                        {
                            name: '铁路公路',
                            itemStyle: {
                                color: '#CD7B38',
                                borderColor: '#CD7B38'
                            }
                        },
                        {
                            name: '物流',
                            itemStyle: {
                                color: '#424242',
                                borderColor: '#424242'
                            }
                        },
                        {
                            name: '非金属材料Ⅱ',
                            itemStyle: {
                                color: '#424242',
                                borderColor: '#424242'
                            }
                        },
                        {
                            name: '航运港口',
                            itemStyle: {
                                color: '#f63185',
                                borderColor: '#f63185'
                            }
                        },
                        {
                            name: '港口航运',
                            itemStyle: {
                                color: '#9CBC59',
                                borderColor: '#9CBC59'
                            }
                        },
                        {
                            name: '航空机场',
                            itemStyle: {
                                color: '#4F4BD9',
                                borderColor: '#4F4BD9'
                            }
                        },
                        {
                            name: '商用车',
                            itemStyle: {
                                color: '#3EC562',
                                borderColor: '#3EC562'
                            }
                        },
                        {
                            name: '乘用车',
                            itemStyle: {
                                color: '#F06F2E',
                                borderColor: '#F06F2E'
                            }
                        },
                        {
                            name: '摩托车及其他',
                            itemStyle: {
                                color: '#C3986D',
                                borderColor: '#C3986D'
                            }
                        },
                        {
                            name: '汽车服务',
                            itemStyle: {
                                color: '#4D291C',
                                borderColor: '#4D291C'
                            }
                        },
                        {
                            name: '塑料',
                            itemStyle: {
                                color: '#4D291C',
                                borderColor: '#4D291C'
                            }
                        },
                        {
                            name: '汽车零部件',
                            itemStyle: {
                                color: '#009c7a',
                                borderColor: '#009c7a'
                            }
                        },
                        {
                            name: '林业Ⅱ',
                            itemStyle: {
                                color: '#986F0B',
                                borderColor: '#986F0B'
                            }
                        },
                        {
                            name: '种植业',
                            itemStyle: {
                                color: '#3C8EA4',
                                borderColor: '#3C8EA4'
                            }
                        },
                        {
                            name: '渔业',
                            itemStyle: {
                                color: '#4F82BE',
                                borderColor: '#4F82BE'
                            }
                        },
                        {
                            name: '养殖业',
                            itemStyle: {
                                color: '#D38017',
                                borderColor: '#D38017'
                            }
                        },
                        {
                            name: '饲料',
                            itemStyle: {
                                color: '#A8CDD7',
                                borderColor: '#A8CDD7'
                            }
                        },
                        {
                            name: '动物保健Ⅱ',
                            itemStyle: {
                                color: '#7A072D',
                                borderColor: '#7A072D'
                            }
                        },
                        {
                            name: '农产品加工',
                            itemStyle: {
                                color: '#859599',
                                borderColor: '#859599'
                            }
                        },
                        {
                            name: '农业综合Ⅱ',
                            itemStyle: {
                                color: '#84AA33',
                                borderColor: '#84AA33'
                            }
                        },
                        {
                            name: '酒店餐饮',
                            itemStyle: {
                                color: '#ff8b67',
                                borderColor: '#ff8b67'
                            }
                        },
                        {
                            name: '食品饮料',
                            itemStyle: {
                                color: 'rgba(106,82,134,255)',
                                borderColor: 'rgba(106,82,134,255)'
                            }
                        },
                        {
                            name: '体育Ⅱ',
                            itemStyle: {
                                color: '#1B587C',
                                borderColor: '#1B587C'
                            }
                        },
                        {
                            name: '专业服务',
                            itemStyle: {
                                color: '#A19574',
                                borderColor: '#A19574'
                            }
                        },
                        {
                            name: '教育',
                            itemStyle: {
                                color: '#918485',
                                borderColor: '#918485'
                            }
                        },
                        {
                            name: '旅游及景区',
                            itemStyle: {
                                color: '#FFA98C',
                                borderColor: '#FFA98C'
                            }
                        },
                        {
                            name: '一般零售',
                            itemStyle: {
                                color: '#4BADC7',
                                borderColor: '#4BADC7'
                            }
                        },
                        {
                            name: '贸易Ⅱ',
                            itemStyle: {
                                color: '#BA144C',
                                borderColor: '#BA144C'
                            }
                        },
                        {
                            name: '专业连锁Ⅱ',
                            itemStyle: {
                                color: '#F0A22E',
                                borderColor: '#F0A22E'
                            }
                        },
                        {
                            name: '计算机',
                            itemStyle: {
                                color: 'rgba(64,105,157,255)',
                                borderColor: 'rgba(64,105,157,255)'
                            }
                        },
                        {
                            name: '旅游零售Ⅱ',
                            itemStyle: {
                                color: '#A28E6A',
                                borderColor: '#A28E6A'
                            }
                        },
                        {
                            name: '互联网电商',
                            itemStyle: {
                                color: '#9F413E',
                                borderColor: '#9F413E'
                            }
                        },
                        {
                            name: '银行',
                            itemStyle: {
                                color: '#40699D',
                                borderColor: '#40699D'
                            }
                        },
                        {
                            name: '半导体',
                            itemStyle: {
                                color: '#989391',
                                borderColor: '#989391'
                            }
                        },
                        {
                            name: "消费电子",
                            itemStyle: {
                                color: '#886CE4',
                                borderColor: '#886CE4'
                            }
                        },
                        {
                            name: '其他电子Ⅱ',
                            itemStyle: {
                                color: '#964305',
                                borderColor: '#964305'
                            }
                        },
                        {
                            name: '元件',
                            itemStyle: {
                                color: '#485FB5',
                                borderColor: '#485FB5'
                            }
                        },
                        {
                            name: '光学光电子',
                            itemStyle: {
                                color: '#87a0c7',
                                borderColor: '#87a0c7'
                            }
                        },
                        {
                            name: '电子化学品Ⅱ',
                            itemStyle: {
                                color: '#FFE2C5',
                                borderColor: '#FFE2C5'
                            }
                        },
                        {
                            name: '小家电',
                            itemStyle: {
                                color: '#40699D',
                                borderColor: '#40699D'
                            }
                        },
                        {
                            name: '黑色家电',
                            itemStyle: {
                                color: '#7e7eb2',
                                borderColor: '#7e7eb2'
                            }
                        },
                        {
                            name: '其他家电Ⅱ',
                            itemStyle: {
                                color: '#587C7D',
                                borderColor: '#587C7D'
                            }
                        },
                        {
                            name: '家电零部件Ⅱ',
                            itemStyle: {
                                color: '#F07F09',
                                borderColor: '#F07F09'
                            }
                        },
                        {
                            name: '厨卫电器',
                            itemStyle: {
                                color: '#E3008C',
                                borderColor: '#E3008C'
                            }
                        },
                        {
                            name: '照明设备Ⅱ',
                            itemStyle: {
                                color: '#4E8542',
                                borderColor: '#4E8542'
                            }
                        },
                        {
                            name: '白色家电',
                            itemStyle: {
                                color: '#B58B80',
                                borderColor: '#B58B80'
                            }
                        },
                        {
                            name: '轨交设备Ⅱ',
                            itemStyle: {
                                color: '#4dc0a6',
                                borderColor: '#4dc0a6'
                            }
                        },
                        {
                            name: '自动化设备',
                            itemStyle: {
                                color: '#6A5286',
                                borderColor: '#6A5286'
                            }
                        },
                        {
                            name: '专用设备',
                            itemStyle: {
                                color: '#F89746',
                                borderColor: '#F89746'
                            }
                        },
                        {
                            name: '通用设备',
                            itemStyle: {
                                color: '#744DA9',
                                borderColor: '#744DA9'
                            }
                        },
                        {
                            name: '工程机械',
                            itemStyle: {
                                color: '#E8B7B7',
                                borderColor: '#E8B7B7'
                            }
                        },
                        {
                            name: '有色金属',
                            itemStyle: {
                                color: '#C32D2E',
                                borderColor: '#C32D2E'
                            }
                        },
                        {
                            name: '休闲食品',
                            itemStyle: {
                                color: '#F0C42E',
                                borderColor: '#F0C42E'
                            }
                        },
                        {
                            name: '饮料乳品',
                            itemStyle: {
                                color: '#881798',
                                borderColor: '#881798'
                            }
                        },
                        {
                            name: '非白酒',
                            itemStyle: {
                                color: '#efa835',
                                borderColor: '#efa835'
                            }
                        },
                        {
                            name: '白酒Ⅱ',
                            itemStyle: {
                                color: '#D8B25C',
                                borderColor: '#D8B25C'
                            }
                        },
                        {
                            name: '食品加工',
                            itemStyle: {
                                color: '#FEB80A',
                                borderColor: '#FEB80A'
                            }
                        },
                        {
                            name: '调味发酵品Ⅱ',
                            itemStyle: {
                                color: '#009DD9',
                                borderColor: '#009DD9'
                            }
                        },
                        {
                            name: '工业金属',
                            itemStyle: {
                                color: '#F07F09',
                                borderColor: '#F07F09'
                            }
                        },
                        {
                            name: '新材料',
                            itemStyle: {
                                color: '#D34817',
                                borderColor: '#D34817'
                            }
                        },
                        {
                            name: '非银金融',
                            itemStyle: {
                                color: '#4E342E',
                                borderColor: '#4E342E'
                            }
                        },
                        {
                            name: '贵金属',
                            itemStyle: {
                                color: '#FFA836',
                                borderColor: '#FFA836'
                            }
                        },
                        {
                            name: '医药生物',
                            itemStyle: {
                                color: 'rgba(159,65,62,255)',
                                borderColor: 'rgba(159,65,62,255)'
                            }
                        },
                        {
                            name: '金属新材料',
                            itemStyle: {
                                color: '#FF6551',
                                borderColor: '#FF6551'
                            }
                        },
                        {
                            name: '小金属',
                            itemStyle: {
                                color: '#72A376',
                                borderColor: '#72A376'
                            }
                        },
                        {
                            name: '能源金属',
                            itemStyle: {
                                color: '#69797E',
                                borderColor: '#69797E'
                            }
                        },
                        {
                            name: '炼化及贸易',
                            itemStyle: {
                                color: '#e65e20',
                                borderColor: '#e65e20'
                            }
                        },
                        {
                            name: '油服工程',
                            itemStyle: {
                                color: '#6E6A68',
                                borderColor: '#6E6A68'
                            }
                        },
                        {
                            name: '农林牧渔',
                            itemStyle: {
                                color: '#5ba33b',
                                borderColor: '#5ba33b'
                            }
                        },
                        {
                            name: '计算机设备',
                            itemStyle: {
                                color: '#5ba33b',
                                borderColor: '#5ba33b'
                            }
                        },
                        {
                            name: '油气开采Ⅱ',
                            itemStyle: {
                                color: '#B4009E',
                                borderColor: '#B4009E'
                            }
                        },
                        {
                            name: '计算机应用',
                            itemStyle: {
                                color: '#B4009E',
                                borderColor: '#B4009E'
                            }
                        },
                        {
                            name: 'IT服务Ⅱ',
                            itemStyle: {
                                color: '#666666',
                                borderColor: '#666666'
                            }
                        }
                    ],
                    links: [
                        {
                            source: '农林牧渔',
                            target: '种植业',
                            value: 357.8399963378906
                        },
                        {
                            source: '行业',
                            target: '农林牧渔',
                            value: 894.5999908447266
                        },
                        {
                            source: '食品饮料',
                            target: '休闲食品',
                            value: 178.9199981689453
                        },
                        {
                            source: '有色金属',
                            target: '小金属',
                            value: 188.52999836206436
                        },
                        {
                            source: '基础化工',
                            target: '塑料',
                            value: 2346.919983509928
                        },
                        {
                            source: '有色金属',
                            target: '贵金属',
                            value: 753.4000000059605
                        },
                        {
                            source: '农林牧渔',
                            target: '养殖业',
                            value: 178.9199981689453
                        },
                        {
                            source: '有色金属',
                            target: '金属新材料',
                            value: 999.159998036921
                        },
                        {
                            source: '食品饮料',
                            target: '调味发酵品Ⅱ',
                            value: 536.7599945068359
                        },
                        {
                            source: '有色金属',
                            target: '能源金属',
                            value: 1831.3799968883395
                        },
                        {
                            source: '行业',
                            target: '汽车',
                            value: 1789.1999816894531
                        },
                        {
                            source: '基础化工',
                            target: '化学原料',
                            value: 1274.8199949413538
                        },
                        {
                            source: '食品饮料',
                            target: '饮料饮品',
                            value: 357.8399963378906
                        },
                        {
                            source: '农林牧渔',
                            target: "饲料",
                            value: 178.9199981689453
                        },
                        {
                            source: '农林牧渔',
                            target: '动物保健Ⅱ',
                            value: 357.8399963378906
                        },
                        {
                            source: '食品饮料',
                            target: '白酒',
                            value: 178.9199981689453
                        },
                        {
                            source: '农林牧渔',
                            target: '渔业',
                            value: 178.9199981689453
                        },
                        {
                            source: '农林牧渔',
                            target: '	农产品加工',
                            value: 1073.5199890136719
                        },
                        {
                            source: '有色金属',
                            target: '工业金属',
                            value: 549.8400026857853
                        },
                        {
                            source: '基础化工',
                            target: '橡胶',
                            value: 1764.499989286065
                        },
                        {
                            source: '基础化工',
                            target: '化学制品',
                            value: 1528.580000281334
                        },
                        {
                            source: '食品饮料',
                            target: '食品加工',
                            value: 357.8399963378906
                        },
                        {
                            source: '有色金属',
                            target: '新材料',
                            value: 869.309983983636
                        },
                        {
                            source: '基础化工',
                            target: '农化制品',
                            value: 1565.109990529716
                        },
                        {
                            source: '行业',
                            target: '电子',
                            value: 2683.7999725341797
                        },
                        {
                            source: '食品饮料',
                            target: '白酒Ⅱ',
                            value: 178.9199981689453
                        },
                        {
                            source: '农林牧渔',
                            target: '农业综合Ⅱ',
                            value: 178.9199981689453
                        },
                        {
                            source: '计算机',
                            target: '软件开发',
                            value: 357.8399963378906
                        },
                        {
                            source: '农林牧渔',
                            target: '林业Ⅱ',
                            value: 178.9199981689453
                        },
                        {
                            source: '基础化工',
                            target: '化学纤维',
                            value: 1149.7999994903803
                        },
                        {
                            source: '计算机',
                            target: '计算机应用',
                            value: 536.7599945068359
                        },
                        {
                            source: '交通运输',
                            target: '航空机场',
                            value: 0.5899999737739563
                        },
                        {
                            source: '汽车',
                            target: '汽车服务',
                            value: 357.8399963378906
                        },
                        {
                            source: '交通运输',
                            target: '航运港口',
                            value: 1356.6899970173836
                        },
                        {
                            source: '汽车',
                            target: '汽车零部件',
                            value: 357.8399963378906
                        },
                        {
                            source: '交通运输',
                            target: '物流',
                            value: 0.5899999737739563
                        },
                        {
                            source: '行业',
                            target: '交通运输',
                            value: 1431.3599853515625
                        },
                        {
                            source: '行业',
                            target: '机械设备',
                            value: 5369.929964579642
                        },
                        {
                            source: '交通运输',
                            target: '铁路公路',
                            value: 0.6399999856948853
                        },
                        {
                            source: '交通运输',
                            target: '港口航运',
                            value: 857.1999968588352
                        },
                        {
                            source: '机械设备',
                            target: '工程机械',
                            value: 1131.7099939212203
                        },
                        {
                            source: '行业',
                            target: '家用电器',
                            value: 2504.8799743652344
                        },
                        {
                            source: '基础化工',
                            target: '化工新材料Ⅱ',
                            value: 2343.4599857851863
                        },
                        {
                            source: '计算机',
                            target: '计算机设备',
                            value: 536.7599945068359
                        },
                        {
                            source: '机械设备',
                            target: '通用设备',
                            value: 216.83999809622765
                        },
                        {
                            source: '基础化工',
                            target: '贵金属材料',
                            value: 1711.1399984136224
                        },
                        {
                            source: '计算机',
                            target: 'IT服务Ⅱ',
                            value: 178.9199981689453
                        },
                        {
                            source: '社会服务',
                            target: '教育',
                            value: 422.28999888151884
                        },
                        {
                            source: '行业',
                            target: '有色金属',
                            value: 10384.949975416064
                        },
                        {
                            source: '汽车',
                            target: '乘用车',
                            value: 178.9199981689453
                        },
                        {
                            source: '社会服务',
                            target: '专业服务',
                            value: 592.1700052022934
                        },
                        {
                            source: '行业',
                            target: '银行',
                            value: 2906.2699892893434
                        },
                        {
                            source: '社会服务',
                            target: '旅游及景区',
                            value: 1448.2899911925197
                        },
                        {
                            source: '社会服务',
                            target: '体育Ⅱ',
                            value: 1120.4800013303757
                        },
                        {
                            source: '社会服务',
                            target: '酒店餐饮',
                            value: 612.1199932694435
                        },
                        {
                            source: '机械设备',
                            target: '专用设备',
                            value: 833.3199937939644
                        },
                        {
                            source: '行业',
                            target: '社会服务',
                            value: 6950.059956334531
                        },
                        {
                            source: '信息服务',
                            target: '传媒',
                            value: 715.6799926757812
                        },
                        {
                            source: '家用电器',
                            target: '其他家电Ⅱ',
                            value: 0.2199999988079071
                        },
                        {
                            source: '非银金融',
                            target: '保险Ⅱ',
                            value: 178.9199981689453
                        },
                        {
                            source: '汽车',
                            target: '商用车',
                            value: 178.9199981689453
                        },
                        {
                            source: '机械设备',
                            target: '自动化设备',
                            value: 573.0499979257584
                        },
                        {
                            source: '行业',
                            target: '轻工制造',
                            value: 8228.39999615401
                        },
                        {
                            source: '家用电器',
                            target: '家电零部件Ⅱ',
                            value: 2310.4499812424183
                        },
                        {
                            source: '	石油石化',
                            target: '油气开采Ⅱ',
                            value: 178.9199981689453
                        },
                        {
                            source: '家用电器',
                            target: '白色家电',
                            value: 0.9200000166893005
                        },
                        {
                            source: '非银金融',
                            target: '证券Ⅱ',
                            value: 178.9199981689453
                        },
                        {
                            source: '行业',
                            target: '石油石化',
                            value: 1610.2799835205078
                        },
                        {
                            source: '非银金融',
                            target: '多元金融',
                            value: 357.8399963378906
                        },
                        {
                            source: '汽车',
                            target: '摩托车及其他',
                            value: 178.9199981689453
                        },
                        {
                            source: '家用电器',
                            target: '厨卫电器',
                            value: 2128.459992274642
                        },
                        {
                            source: '电子',
                            target: '元件',
                            value: 715.6799926757812
                        },
                        {
                            source: '电子',
                            target: '光学光电子',
                            value: 178.9199981689453
                        },
                        {
                            source: '商贸零售',
                            target: '一般零售',
                            value: 911.4700058028102
                        },
                        {
                            source: '行业',
                            target: '医药生物',
                            value: 7388.099954992533
                        },
                        {
                            source: '商贸零售',
                            target: '专业连锁Ⅱ',
                            value: 903.9400005489588
                        },
                        {
                            source: '商贸零售',
                            target: '旅游零售Ⅱ',
                            value: 1326.5300009772182
                        },
                        {
                            source: '家用电器',
                            target: '照明设备Ⅱ',
                            value: 827.3899968340993
                        },
                        {
                            source: '行业',
                            target: '信息服务',
                            value: 178.9199981689453
                        },
                        {
                            source: '商贸零售',
                            target: '互联网电商',
                            value: 685.6899967193604
                        },
                        {
                            source: '电子',
                            target: '电子化学品Ⅱ',
                            value: 178.9199981689453
                        },
                        {
                            source: '家用电器',
                            target: '小家电',
                            value: 1781.909985654056
                        },
                        {
                            source: '商贸零售',
                            target: '	贸易Ⅱ',
                            value: 493.6499986946583
                        },
                        {
                            source: '家用电器',
                            target: '黑色家电',
                            value: 361.3899962902069
                        },
                        {
                            source: '医药生物',
                            target: '医疗服务',
                            value: 715.6799926757812
                        },
                        {
                            source: '医药生物',
                            target: '化学制药',
                            value: 536.7599945068359
                        },
                        {
                            source: '医药生物',
                            target: '医疗器械',
                            value: 357.8399963378906
                        },
                        {
                            source: '轻工制造',
                            target: '家居用品',
                            value: 3172.9999914616346
                        },
                        {
                            source: '银行',
                            target: '农商银行Ⅱ',
                            value: 1750.7899813987315
                        },
                        {
                            source: '电子',
                            target: '半导体',
                            value: 357.8399963378906
                        },
                        {
                            source: '电子',
                            target: '消费电子',
                            value: 894.5999908447266
                        },
                        {
                            source: '医药生物',
                            target: '中药Ⅱ',
                            value: 536.7599945068359
                        },
                        {
                            source: '银行',
                            target: '国有大型银行Ⅱ',
                            value: 0.8700000047683716
                        },
                        {
                            source: '轻工制造',
                            target: '包装印刷',
                            value: 812.6600027084351
                        },
                        {
                            source: '轻工制造',
                            target: '家用轻工',
                            value: 500.36999743431807
                        },
                        {
                            source: '行业',
                            target: '商贸零售',
                            value: 8040.7799860313535
                        },
                        {
                            source: '电子',
                            target: '其他电子Ⅱ',
                            value: 178.9199981689453
                        },
                        {
                            source: '石油石化',
                            target: '炼化及贸易',
                            value: 178.9199981689453
                        },
                        {
                            source: '石油石化',
                            target: '油服工程',
                            value: 357.8399963378906
                        },
                        {
                            source: '轻工制造',
                            target: '文娱用品',
                            value: 1648.2200061008334
                        },
                        {
                            source: '轻工制造',
                            target: '造纸',
                            value: 2162.8300000429153
                        },
                        {
                            source: '银行',
                            target: '股份制银行Ⅱ',
                            value: 1862.4599857926369
                        },
                        {
                            source: '医药生物',
                            target: '生物制品',
                            value: 178.9199981689453
                        },
                        {
                            source: '行业',
                            target: '基础化工',
                            value: 9497.539981640875
                        },
                        {
                            source: '医药生物',
                            target: '医药商业',
                            value: 178.9199981689453
                        },
                        {
                            source: '行业',
                            target: '食品饮料',
                            value: 1789.1999816894531
                        },
                        {
                            source: '银行',
                            target: '城商银行Ⅱ',
                            value: 790.36997512728
                        },
                        {
                            source: '机械设备',
                            target: '轨交设备Ⅱ',
                            value: 1425.7099913656712
                        },
                        {
                            source: '行业',
                            target: '计算机',
                            value: 1968.1199798583984
                        }
                    ],
                    lineStyle: {
                        color: 'source',
                        curveness: 0.5
                    },
                    itemStyle: {
                        color: '#1f77b4',
                        borderColor: '#1f77b4'
                    },
                    label: {
                        color: 'rgba(0,0,0,0.7)',
                        fontFamily: 'Arial',
                        fontSize: 10
                    }
                }
            ],
            tooltip: {
                trigger: 'item'
            }
        };
        myChart_draw.setOption(option);
    }

    document.addEventListener("DOMContentLoaded", function () {
        const header = document.querySelector(".industry-header");
        const icon = document.querySelector(".industry-icon");
        const content = document.querySelector(".industry-content");

        let isContentExpanded = false; // 初始化为收起状态

        header.addEventListener("click", function () {
            if (isContentExpanded) {
                content.style.height = "0";
                icon.style.transform = "rotate(0deg)";
            } else {
                content.style.height = content.scrollHeight + "px";
                icon.style.transform = "rotate(90deg)";
            }

            isContentExpanded = !isContentExpanded; // 切换状态
        });
    });

    var search_neo4j_data = [{{ industry_neo4j_data|safe }}]
    var industry = [{{ industry_data|safe }}]
    industry_data = industry[0]
    var data2 = search_neo4j_data[0]['data']
    var links2 = search_neo4j_data[0]['links']
    console.log(data2)
    console.log(links2)
    var myChart2 = echarts.init(document.getElementById('container_search'));
    var categories2 = [{name: "公司"}, {name: "行业"}, {name: "实例"}];

    option2 = {
        // 图的标题
        title: {
            text: '查询行业关系图谱'
        },
        // 提示框的配置
        tooltip: {
            position: [10, 10],
            formatter: function (params) {
                const data = params.data;
                const des = data.des;
                // 生成表格代码
                let tableHTML = '<div style="max-width: 300px; word-wrap: break-word; white-space: pre-wrap;">';
                // 设置最大宽度为 200 像素，并允许换行

                for (const key in des) {
                    if (des.hasOwnProperty(key)) {
                        const value = des[key];
                        tableHTML += `<div>${key}: ${value}</div>`;
                    }
                }
                tableHTML += '</div>';
                return tableHTML;
            }
        },

        // 工具箱
        toolbox: {
            // 显示工具箱
            show: true,
            feature: {
                mark: {
                    show: true
                },
                // 还原
                restore: {
                    show: true
                },
                // 保存为图片
                saveAsImage: {
                    show: true
                }
            }
        },
        legend: [{
            data: categories2.map(function (a) {
                return a.name;
            })
        }],
        series: [{
            type: 'graph', // 类型:关系图
            layout: 'force', //图的布局，类型为力导图
            symbolSize: 40, // 调整节点的大小
            roam: true, // 是否开启鼠标缩放和平移漫游。默认不开启。如果只想要开启缩放或者平移,可以设置成 'scale' 或者 'move'。设置成 true 为都开启
            edgeSymbol: ['circle', 'arrow'],
            edgeSymbolSize: [2, 10],
            edgeLabel: {
                normal: {
                    textStyle: {
                        fontSize: 20
                    }
                }
            },
            force: {
                repulsion: 2500,
                edgeLength: [10, 50]
            },
            draggable: true,
            lineStyle: {
                normal: {
                    width: 2,
                    color: '#4b565b',
                }
            },
            edgeLabel: {
                normal: {
                    show: true,
                    formatter: function (x) {
                        return x.data.name;
                    }
                }
            },
            label: {
                normal: {
                    show: true,
                    textStyle: {}
                }
            },

            // 数据
            data: data2,
            links: links2,
            categories: categories2,
        }]
    };
    myChart2.setOption(option2);
    document.getElementById("industry_name").value = "行业名称:" + data2[0].name
    document.getElementById("industry_level").value = "行业级别:" + data2[0].des["级别"]

</script>
<!-- End custom js for this page-->
</body>

</html>


